package com.example.controller;


import com.example.entity.Student;
import com.example.result.Result;
import com.example.service.IStudentService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 陈昌吉
 * @since 2024-05-06
 */
@ResponseBody
@CrossOrigin
@Data
@Slf4j
@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private IStudentService iStudentService;

    //    获取所有student信息
    @GetMapping("/getAllStudent")
    public Result<List<Student>> getAllStudent(){
        List<Student> studentall= iStudentService.getAll();
        return Result.success(studentall);
    }
}
